package com.abvnet.project.water.api.web;

import com.abvnet.framework.web.controller.BaseController;
import com.abvnet.framework.web.domain.AjaxResult;
import com.abvnet.project.water.project.domain.ProjectProgress;
import com.abvnet.project.water.project.service.IProjectProgressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/project/progress")
public class ApiProjectProgressController extends BaseController {

    @Autowired
    private IProjectProgressService projectProgressService;

    @GetMapping("/list")
    public AjaxResult list(@RequestParam("projectId") Long projectId) {
        return AjaxResult.success(projectProgressService.selectProjectProgressByProjectId(projectId));
    }

    @PostMapping("/edit")
    public AjaxResult editSave(ProjectProgress projectProgress) {
        projectProgressService.updateProjectProgress(projectProgress);
        return success();
    }
}
